/**********************************************************************************
* CLASS 
*		AnimationContainer
*
* DESCRIPTION
*       Use for keep group of animation in parallel for display.
* 		Contend manipulate function set:
*			- addCommand
*           - removeCommand
*           - getCommand
*           - setCommand
*           - getSize
*
* REVISION HISTORY
*		Revision 1.0 2008/09/03 Atthaboon S.
*		First Release.
*
**********************************************************************************/
var AnimationContainer = Class.create({
    
    /****************************************************
	* FUNCTION 
	*		initialize
	*
	* ARGUMENTS
    *
	* DESCRIPTION
	* 		initialize the Genesis object.
	*
	****************************************************/
  	initialize: function()
  	{
		this.animeObject_container = new Array();
  	},
    
    /****************************************************
	* FUNCTION 
	*		addCommand
	*
	* DESCRIPTION
	* 		Add command in the command container for execute.
	*
	* ARGUMENTS
	*		command		   	:	String of command
	*
	****************************************************/
	addCommand : function(command)
	{	
        var temp_command  = eval(command);
        var animeObj = new AnimationObject(command,temp_command);
        this.animeObject_container[this.animeObject_container.length] = animeObj;
	},
    
    /****************************************************
	* FUNCTION 
	*		removeCommand
	*
	* DESCRIPTION
	* 		Remove command in the command container for execute.
	*
	* ARGUMENTS
	*		index		   	        :	index of command that you want to remove
	*
	****************************************************/
	removeCommand : function(index)
	{	
        array_remove(this.animeObject_container,index);
	},    
    
    /****************************************************
	* FUNCTION 
	*		getCommand
	*
	* DESCRIPTION
	* 		Get command frome the command container for execute.
	*
	* ARGUMENTS
	*		index		   	:	index of command that you want to get.
    *
    * RETURN
	*       command
	****************************************************/
	getCommand : function(index)
	{	
        if(this.animeObject_container.length > index && index >= 0)
        {
            return this.animeObject_container[index];
        }
        return ;
	},
    
    /****************************************************
	* FUNCTION 
	*		setCommand
	*
	* DESCRIPTION
	* 		Set command frome the command container for execute.
	*
	* ARGUMENTS
	*		index		   	:	index of command that you want to set.
 	*       animeObj        :   animation Object
    *
	****************************************************/
    setCommand : function(index,animeObj)
    {
        if(this.animeObject_container.length > index && index >= 0)
        {
            this.animeObject_container[index] = animeObj;
        }
    },
    
    /****************************************************
	* FUNCTION 
	*		getSize
	*
	* DESCRIPTION
	* 		Get size frome the command container for execute.
	*
	* ARGUMENTS
    *
    * RETURN
    *       size    	:        size of command container.
    *
	****************************************************/
	getSize : function()
	{	
        return this.animeObject_container.length;
	}
});
